package cn.sylinx.hbatis.ext.xmapper.repository;

import cn.sylinx.hbatis.ext.AbstractDaoSingleton;
import cn.sylinx.hbatis.ext.xmapper.spi.XmapperServiceManager;

public class DaoSingleton extends AbstractDaoSingleton<DaoService> {

	public static final DaoSingleton ME = new DaoSingleton();

	@Override
	protected String getDefaultDatasourceName() {
		return XmapperServiceManager.getXmapperService().getDatasourceName();
	}

	@Override
	protected DaoService createDaoService(String datasourceName) {
		return new DaoServiceImpl(new RepositoryImpl(datasourceName));
	}

}
